package com.duanjw.springframework.ioc.lifecycle;

import com.duanjw.springframework.ioc.lifecycle.config.AppConfig;
import com.duanjw.springframework.ioc.lifecycle.dao.impl.UserDaoImpl3;
import com.duanjw.springframework.ioc.lifecycle.service.UserServiceImpl;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;

/**
 * 生命周期回调
 *
 * @author duanjw
 */
public class LifecycleCallbacksApplication {
    public static void main(String[] args) {
        AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext(AppConfig.class);
        UserServiceImpl bean = ctx.getBean(UserServiceImpl.class);
        bean.show();

    }
}

